package link.anyauto.fsmgr.vo;

import java.util.ArrayList;
import java.util.List;

import link.anyauto.fsmgr.domain.Function;
import link.anyauto.fsmgr.domain.FunctionGroup;

/**
 * Created by LYQ on 2016/7/19.
 */
public class FunctionGroupVO {

    public FunctionGroupVO(FunctionGroup group) {
        this.group = group;
        if(group.functions != null && group.functions.size() > 0) {
            funcs = new ArrayList<>();
            for(Function func : group.functions) {
                funcs.add(new FunctionVO(func));
            }
        } else {
            funcs = null;
        }
    }

    public String getName() {
        return group.name;
    }

    public String getIconUrl() {
        return group.iconUrl;
    }

    public int getIconRes() {
        return group.iconRes;
    }

    public List<FunctionVO> getFuncs() {
        return funcs;
    }

    final List<FunctionVO> funcs;
    final FunctionGroup group;
}
